package hu.kisprof.quiz.model.bean;

import java.io.Serializable;
import java.net.InetAddress;


public class Player implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 620466094900579971L;
	public static boolean MALE = true;
	public static boolean FEMALE = false;
	
	
	private String username;
	private String password;
	private String name;
	private boolean gender;
	private int point;
	private int age;
	private int type;
	private String email;
	private int zipcode;
	private String addr;
	private int edu;
	private InetAddress iAddr;
	private int port;
	
	
	public Player(){
		username = "anonymous";
		password = "pass";
		name = "JOHN DOE";
		gender = MALE;
		age = 0;
		point = 1000;
		type=0;
	}
	
	public Player(	
					String username,
					String pass,
					String email,
					String name,
					int zipcode,
					String addr,
					int age,
					Boolean gender,
					int edu,
					int type,
					int point
					){
		this.username= username;
		this.password = pass;
		this.name = name;
		this.gender = gender;
		this.age = age;
		this.point = point;
		this.type = type;
		this.setEmail(email);
		this.zipcode=zipcode;
		this.edu=edu;
		this.addr=addr;
	}





	public boolean getGender() {
		return gender;
	}





	public void setGender(boolean gender) {
		this.gender = gender;
	}





	public String getUsername() {
		return username;
	}


	public String getPassword() {
		return password;
	}


	public String getName() {
		return name;
	}


	public int getPoint() {
		return point;
	}


	public int getAge() {
		return age;
	}

	public int getType() {
		return type;
	}

	public InetAddress getIAddr() {
		return iAddr;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getEmail() {
		return email;
	}

	public void setPort(int port) {
		this.port = port;
	}

	public String getAddr() {
		return addr;
	}

	public void setAddr(String addr) {
		this.addr = addr;
	}

	public int getPort() {
		return port;
	}

	public int getZipcode() {
		return zipcode;
	}

	public void setZipcode(int zipcode) {
		this.zipcode = zipcode;
	}

	public int getEdu() {
		return edu;
	}

	public void setEdu(int edu) {
		this.edu = edu;
	}

	public void setIAddr(InetAddress iaddr) {
		this.iAddr = iaddr;
	}

	public void setType(int type) {
		this.type = type;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public void setUsername(String username) {
		this.username = username;
	}


	public void setPassword(String password) {
		this.password = password;
	}


	public void setName(String name) {
		this.name = name;
	}


	public void setPoint(int point) {
		this.point = point;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((username == null) ? 0 : username.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Player other = (Player) obj;
		if (username == null) {
			if (other.username != null)
				return false;
		} else if (!username.equals(other.username))
			return false;
		return true;
	}
	
	public String toString(){
		return username;
	}

}
